package com.xrz.sxm.aj.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.xrz.sxm.aj.activity.R;

public class GridViewAdapter extends BaseAdapter{

	private Context ctx;
	private LayoutInflater m_Inflater;
	private List<String> m_Bings;
	public GridViewAdapter(Context ctx,List<String> list){
		this.ctx = ctx;
		this.m_Bings = list;
		m_Inflater = LayoutInflater.from(ctx);
	}
	@Override
	public int getCount() {
		return m_Bings.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		if(arg1 == null){
			arg1 = m_Inflater.inflate(R.layout.item_gridview, null);
		}
		TextView item_tv = (TextView) arg1.findViewById(R.id.item_tv);
		item_tv.setText(m_Bings.get(arg0));
		return arg1;
	}

}
